import Vue from 'vue';

import App from './App.vue';

import vueRouter from 'vue-router';

Vue.use(vueRouter);

import vueResource from 'vue-resource';
Vue.use(vueResource);

import home from './components/home.vue'

import newslist from './components/news/newslist.vue'
import newsinfo from './components/news/newsinfo.vue';
var router = new vueRouter({
	linkActiveClass:'mui-active',
	routes:[
	{path:'/',redirect:'/home'},
	{path:'/home',component:home},
	{path:'/news/newslist',component:newslist},
	{path:'/news/newsinfo/:id',component:newsinfo}
	]
})

//注册mint-ui
import mintui from 'mint-ui';
import 'mint-ui/lib/style.css';
Vue.use(mintui);

//注册mui的css样式
import '../statics/mui/css/mui.css'
import '../statics/mui/css/icons-extra.css'

//定义全局过滤器实现日期格式化
import moment from 'moment';
Vue.filter('datefmt',function(input,fmtstring){
//	使用momentjs这个日期格式化类库实现日的格式化功能
	return moment(input).format(fmtstring);
});


import '../statics/css/site.css'
new Vue({
	el:'#app',
	router:router,
	render:c=>c(App)
})
